<!doctype html>
<html ng-app="myapp">
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <script src="../lib/angular.js" ></script>
        <script src="../lib/angular-route.js" ></script>
        <script type="text/javascript">

            angular.module("myapp",['ngRoute']).controller("formCtrl",function ($scope){
                $scope.user={name:'tom',
                sex:'boy'};
                $scope.democlick=function(){
                    alert($scope.user.name+"--"+$scope.user.sex);
                };
            });
        </script>
    </head>
<body ng-controller="formCtrl">
    <h1>Hello</h1>
    <div>
        <p>
            <input type="text" ng-model="user.name" />
        </p>
        <p>
            <input type="text" ng-model="user.sex" />
        </p>
        <button type="button" ng-click="democlick()">点击</button>

        <p>{{user.name}}</p>
        <p>{{user.sex}}</p>
    </div>
</body>
</html>
